"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));

var _utils = require("../utils");

var _constant = require("../utils/constant");

var _functional = require("../utils/functional");

var _popup = require("../mixins/popup");

var _popup2 = _interopRequireDefault(require("../popup"));

var _createNamespace = (0, _utils.createNamespace)('notify'),
    createComponent = _createNamespace[0],
    bem = _createNamespace[1];

function Notify(h, props, slots, ctx) {
    var style = {
        color: props.color,
        background: props.background
    };
    return h(_popup2.default, (0, _babelHelperVueJsxMergeProps.default)([{
        "attrs": {
            "value": props.value,
            "position": "top",
            "overlay": false,
            "duration": 0.2,
            "lockScroll": false
        },
        "style": style,
        "class": [bem([props.type]), props.className]
    }, (0, _functional.inherit)(ctx, true)]), [props.message]);
}

Notify.props = (0, _extends2.default)({}, _popup.popupMixinProps, {
    background: String,
    className: null,
    message: [Number, String],
    getContainer: [String, Function],
    type: {
        type: String,
        default: 'danger'
    },
    color: {
        type: String,
        default: _constant.WHITE
    },
    duration: {
        type: Number,
        default: 3000
    }
});

var _default = createComponent(Notify);

exports.default = _default;